home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 March / PCWorld_2003-03_cd.bin / Software / Topware / activeperl / ActivePerl / Perl / eg / Windows Script Host / specialfolder.wsf < prev    next >
Encoding:
Text File  |  2000-08-10  |  443 b   |  19 lines

  1. <Job Id="SpecialFolder">
  2. <script language=PerlScript>
  3.     $WshShell = $WScript->CreateObject("WScript.Shell");
  4.     $numFolders = $WshShell->SpecialFolders->{Count};
  5.     $title = "PerlScript & WSH Example";
  6.     $style = 1;
  7.  
  8.     for($i=0; $i<$numFolders; $i++) {
  9.     $ok_or_cancel =  $WshShell->Popup(
  10.              $WshShell->SpecialFolders($i), 
  11.              undef, 
  12.              $title, 
  13.              $style);
  14.  
  15.     exit if ($ok_or_cancel == 2);
  16. }
  17. </script>
  18. </job>
  19.